
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import 'element-plus/theme-chalk/dark/css-vars.css'
import { Global } from './Global'
// Import the CSS or use your own!
import "vue-toastification/dist/index.css";
import "./assets/main.css";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { AuthService } from './apis/admin/auth'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

Global.modules = import.meta.glob('./views/**/*.vue');
const app = createApp(App)


//注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}

Global.init();


app.use(router);
app.use(ElementPlus, {
    locale: zhCn,
  });

window.setTimeout(AuthService.refreshToken, 30000);
app.mount('#app')
